package com.lancoo.znbkxx.teacher.aibkTestCoach.kBase

import android.util.SparseArray
import android.view.View
import androidx.recyclerview.widget.RecyclerView

open class KBaseRecyclerViewHolder(convertView: View) : RecyclerView.ViewHolder(convertView) {
    private val views: SparseArray<View?> = SparseArray()
    val convertView: View = convertView
    fun <T : View?> getView(viewId: Int): T? {
        var view = views[viewId]
        if (view == null) {
            view = convertView.findViewById(viewId)
            views.put(viewId, view)
        }
        return view as T?
    }

}